package binderipcservicemanager

import android.os.IBinder
import android.os.RemoteException
import kotlin.jvm.Throws

data class ServiceEntry(
    val name: String?,
    val callingPid: Int,
    val callingUid: Int,
    val binder: IBinder?,
    val recipient: IBinder.DeathRecipient?
) {
    @Throws(RemoteException::class)
    fun linkToDeath() {
        if (binder != null && recipient != null) {
            binder.linkToDeath(recipient, 0)
        }
    }

    @Throws(RemoteException::class)
    fun unlinkToDeath() {
        if (binder != null && recipient != null) {
            binder.unlinkToDeath(recipient, 0)
        }
    }
}
